// components/replyInput/replyInput.js
Component({
  /**
   * 组件的属性列表
   */
  properties: {
    focus: {
      type: Boolean
    },
    initContent: {
      type: String,
    },
    username: {
      type: String,
    }
  },

  /**
   * 组件的初始数据
   */
  data: {
    InputBottom: 0,
    content: '',
  },
  lifetimes: {
    attached(){
      
      
      this.setData({
        content: this.data.initContent
      })
    }
  },
  /**
   * 组件的方法列表
   */
  methods: {
    preventBubble(){

    },
    InputFocus(e) {
      this.setData({
        InputBottom: e.detail.height
      })
    },
    InputBlur(e) {
      this.setData({
        InputBottom: 0
      })
    },
    InputChange(e){
      const {value} = e.detail
      this.setData({
        content: value
      })
      this.triggerEvent('input', value)
    },
    sendReply(){
      this.triggerEvent('send', this.data.content)
    }
  }
})